package com.xjc.config;
import com.xjc.pojo.A;
import com.xjc.pojo.B;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author:谢君臣
 * @Date:2021/6/3-16:56
 * @version:1.0
 * @function:
 */
@Configuration
@ComponentScan(basePackages = "com.xjc")
@MapperScan(basePackages = "com.xjc.mapper")
@EnableTransactionManagement
@EnableAspectJAutoProxy
public class Myconfig {
    @Autowired
    private B b;
    @Autowired
    private A a;
    @Bean
    public A a(){
        A a = new A();
        a.setB(b);
        return a;
    }
    @Bean
    public B b() {
        B b = new B();
        b.setA(a);
        return b;
    }
}
